﻿using System;
using System.Data;
using System.Collections.Generic;
using SERP.DAO;
namespace SERP.Controllers{
public class SalaryRulePersonTypeControllerBase : Controller{
	public SalaryRulePersonTypeControllerBase()
		: base()
	{
	}
	private static SalaryRulePersonTypeDAO _Service; 
	public static SalaryRulePersonTypeDAO Service{
		get{
			if(_Service==null)
				_Service = new SalaryRulePersonTypeDAO();
			return _Service;
		}
		set{
			_Service = value;
		}
	}
    //Copy data from data row in grid to object
    public SalaryRulePersonTypeEntity MapDataRowToObject(DataRow row){
		SalaryRulePersonTypeEntity o = new SalaryRulePersonTypeEntity();
		 if(!row.IsNull("SalaryRuleId"))
			o.SalaryRuleId=ConvertInt(row["SalaryRuleId"]);
		 if(!row.IsNull("PersonTypeId"))
			o.PersonTypeId=(Int32)(row["PersonTypeId"]);
		 if(!row.IsNull("SalaryRulePersonTypeId"))
		    o.SalaryRulePersonTypeId=(Int32)(row["SalaryRulePersonTypeId"]);
		 return o;
    }
	//Copy data from object to data row in grid    
    public void MapObjectToDataRow(SalaryRulePersonTypeEntity o,DataRow row){
		row["SalaryRuleId"]=o.SalaryRuleId;
		row["PersonTypeId"]=o.PersonTypeId;
		row["SalaryRulePersonTypeId"]=o.SalaryRulePersonTypeId;
    }
}
}
